//import Cookies from 'js-cookie'

const TokenKey = 'huaxin_token'
const userInfo = 'user_info'

export function getToken() {
  return localStorage.getItem(TokenKey);
}

export function setToken(token) {
  return localStorage.setItem(TokenKey,token);
}

export function removeToken() {
  return localStorage.removeItem(TokenKey);
}

//@date 新增添加用户信息缓存信息
export function addUserInfo(data) {

  return localStorage.setItem(userInfo,JSON.stringify(data));
}

export function getUserInfo() {
  return JSON.parse(localStorage.getItem(userInfo));
}

export function removeInfo() {
  return localStorage.removeItem(userInfo);
}
